<?php


namespace app\index\business;


use app\common\model\News;
use think\Exception;

class newsBus
{
    public $newsModel = null;
    public function __construct()
    {
        $this->newsModel = new News();
    }

    public function getListPageBus($where,$paging){
        $res = $this->newsModel->getListByWhere($where,$paging);
        return $res;
    }
    public function getDetailBus($id){
        $res = $this->newsModel->getDetailById($id);
        if(empty($res)){
            throw new Exception('未查询此篇资讯');
        }
        return $res;
    }
}